package com.ai.entity.security.page;

import com.ai.entity.security.SysRole;
import com.ai.entity.comm.page.SysBasePage;
import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;


@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SysRolePage extends SysBasePage<SysRole> {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty("角色名")
    private String roleName;

    @ApiModelProperty("角色说明")
    private String roleDescription;

    public QueryWrapper<SysRole> getQuery(QueryWrapper<SysRole> queryWrapper) {
        return super.getQuery(queryWrapper)
                .like(!StringUtils.isEmpty(roleName),"role_name",roleName)
                .like(!(StringUtils.isEmpty(roleDescription)),"role_description",roleDescription);
    }


}
